package com.ojoin.trade.supplyloan_core.web.service.renew;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.ojoin.trade.common.CallBack;
import com.ojoin.trade.common.web.domain.BaseEntity;
import com.ojoin.trade.common.web.domain.Dict;
import com.ojoin.trade.common.web.service.DictService;
import com.ojoin.trade.supplyloan_core.web.service.TbSlLoanApplicationService;

@Component
public class BLHTRenew implements CallBack{

	@Autowired
	private  DictService dictService;
	
	@Autowired
	private TbSlLoanApplicationService slLoanService;
	
	@Override
	public void updateHandle(Map arg) {
		Integer joinUserId=(Integer)arg.get("joinUserId");
		Integer fileId=(Integer)arg.get("fileId");
		String renewType=(String)arg.get("renewType");
		String expiredDate=(String)arg.get("expiredDate");
		
		
		Dict dict=new Dict();
		dict.setId((Integer)(arg.get("dictId")));
		dict.setDelFlag(BaseEntity.DEL_FLAG_DELETE);
		dictService.delete(dict);
		
		slLoanService.updateBLHTexpiredDate(joinUserId, expiredDate);
	}

}
